package com.kabigon.multiverse.exception;

import org.springframework.http.HttpStatus;

/**
 * 暂未登录或token已经过期的异常
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.multiverse.exception
 * @data 2022/2/17 23:20
 */
public class UnauthorizedException extends BaseException {


    public UnauthorizedException(String message, Throwable cause) {
        super(message, cause);
    }

    public UnauthorizedException(Throwable cause) {
        super(cause);
    }

    public UnauthorizedException(String message) {
        super(message);
    }

    @Override
    public int getCode() {
        return HttpStatus.UNAUTHORIZED.value();
    }

    @Override
    public String getDescription() {
        return getCause().getMessage();
    }

    @Override
    public String getMessage() {
        return "暂未登录或token已经过期的异常";
    }
}
